package com.yubest.designpattern.behavior.memento;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * 数据对象
 *
 * @Author: hweiyu
 * @Date: 2022/10/27 12:11
 */
@Data
@AllArgsConstructor
public class Record {

    private String body;

    public RecordMemento backup() {
        return new RecordMemento(body);
    }

    public void restore(RecordMemento memento) {
        this.body = memento.getBody();
    }
}
